package com.zls;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class mybatisPlusApplication {
    public static void main(String[] args) {
        SpringApplication.run(mybatisPlusApplication.class,args);
    }
    //分页插件
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){

        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return mybatisPlusInterceptor;
    }
//    @Bean
//    public PaginationInnerInterceptor  paginationInnerInterceptor(){
//        return  new PaginationInnerInterceptor(DbType.MYSQL);
//    }
}
